package com.woyao.core.service;

import com.woyao.core.model.BaseResponse;
import com.woyao.core.model.GetMyReferResponse;
import com.woyao.core.model.GetNextChanceResponse;
import com.woyao.core.model.GetOrganizationResponse;
import com.woyao.core.model.GetPersonResponse;

import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * Created by summerwind on 2016-05-13.
 */

public interface ChanceService {
    /**
     * 下个机会
     * @param userId
     * @param businessId
     * @param longitude
     * @param latitude
     * @param direction
     * @param ignore
     * @return
     */
    @POST("next")
    @FormUrlEncoded
    Call<GetNextChanceResponse> next(@Field("userid") int userId, @Field("bid") Integer businessId,
                                     @Field("lng")String longitude,
                                     @Field("lat")String latitude,
                                     @Field("direction") String direction,
                                     @Field("ignore") String ignore );




    /**
     * 申请合作
     * @param userId
     * @param businessId
     * @param demandid
     * @param content
     * @return
     */
    @POST("apply")
    @FormUrlEncoded
    Call<BaseResponse> apply(@Field("userid")int userId,@Field("bid")int businessId,
                             @Field("demandid")int demandid,@Field("content")String content);

    /**
     * getuser
     * @param userId
     * @param businessId
     * @return
     */
    @POST("get")
    Call<GetNextChanceResponse> getChance(@Query("userid") int userId, @Query("bid")int businessId);


    /**
     * getuser
     * @param userId
     * @param relationId
     * @return
     */
    @POST("getperson")
    Call<GetPersonResponse> getPerson(@Query("userid") int userId, @Query("id")int relationId);

    /**
     * getuser
     * @param userId
     * @param orgId
     * @return
     */
    @POST("getorganization")
    Call<GetOrganizationResponse> getOrganization(@Query("userid") int userId, @Query("id")int orgId);




    /**
     * 分享
     * @param userId
     * @param bid
     * @param objects
     * @return
     */
    @POST("refer")
    @FormUrlEncoded
    Call<BaseResponse> refer(@Field("userid") int userId, @Field("bid")int bid, @Field("objects")String objects, @Field("demands")String demands );



    /**
     * 分享
     * @param userId
     * @param bid
     * @param attitude
     * @return
     */
    @POST("refer")
    @FormUrlEncoded
    Call<BaseResponse> declare(@Field("userid") int userId, @Field("bid")int bid , @Field("attitude")String attitude  );


    /**
     * 分享
     * @param userId
     * @param bid
     * @return
     */
    @POST("getmyrefer")
    @FormUrlEncoded
    Call<GetMyReferResponse> getMyRefer(@Field("userid") int userId, @Field("bid")int bid , @Field("keyword")String keyword  );



}
